package jp.isisredirect.DreamWaverFirst;

import android.content.res.Resources;
//import android.text.SpannableStringBuilder;
//import android.text.style.RelativeSizeSpan;
//import android.text.style.SubscriptSpan;
import android.view.View;
//import android.view.ViewGroup;
import android.widget.CompoundButton;
//import android.widget.TextView;
import android.widget.ToggleButton;
import android.widget.CompoundButton.OnCheckedChangeListener;

public class RecButtonController implements OnCheckedChangeListener {
	private DreamWaverFirstActivity mActivity;
	private ToggleButton mButton;

	RecButtonController(DreamWaverFirstActivity activity, int number,
			Resources res, boolean vertical) {
		mActivity = activity;
	}

	public void attachToView(View targetView) {
		mButton = (ToggleButton) targetView;
		mButton.setOnCheckedChangeListener(this);
	}

	public void onCheckedChanged(CompoundButton arg0, boolean isChecked) {
		if (mActivity != null) {
			if (isChecked) {
				mActivity.startRecord();
			} else {
				mActivity.stopRecord();
			}
		}
	}
	public void resetButton() {
		mButton.setChecked(false);
	}
}
